<template>
  <v-swiper
    :list="swiperList"
    autoplay
    height="750rpx"
    width="100vw"
  />
</template>

<script setup lang="ts">
const props = defineProps<{
  product: SpuVO;
}>();

const swiperList = computed(() => {
  if (!props.product) return [];
  const list: { src: string; isVideo?: boolean }[] = [];
  if (props.product.video) {
    list.push({ src: props.product.video, isVideo: true });
  }
  list.push(...props.product.banner_image.map((src) => ({ src })));
  return list;
});
</script>
